home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / DEMO_APP / FIELD.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  1.7 KB  |  51 lines

  1. package sub_arctic.demo_apps;
  2.  
  3. import sub_arctic.lib.label;
  4. import sub_arctic.lib.oneline_text_display;
  5. import sub_arctic.lib.base_parent_interactor;
  6. import sub_arctic.constraints.std_function;
  7.  
  8. /**
  9.  * This little composite displays a label and oneline_text_display.
  10.  */
  11.  
  12. public class field extends base_parent_interactor {
  13.   /**
  14.    * Construct a field given the name and value and how wide to make 
  15.    * the label.
  16.    */
  17.   public field(String name, int name_width, String value) {
  18.     label l =new label(name,name_width);
  19.     oneline_text_display otd=new oneline_text_display(value);
  20.     add_child(l);
  21.     add_child(otd);
  22.  
  23.     /* set the constraints on us first */
  24.     set_x_constraint(std_function.offset(ZERO,10));
  25.     set_w_constraint(std_function.offset(PARENT.W(),-10));
  26.     set_h_constraint(std_function.eq(MAX_CHILD.H()));
  27.     /* put the constraints/values on the kids */
  28.     l.set_x(0);
  29.     l.set_y(0);
  30.     otd.set_x_constraint(std_function.offset(PREV_SIBLING.X2(),10));
  31.     otd.set_w_constraint(std_function.fill(PREV_SIBLING.X2(),PARENT.X2(),20));
  32.     otd.set_y(0);
  33.   }
  34. }
  35. /*=========================== COPYRIGHT NOTICE ===========================
  36.  
  37. This file is part of the subArctic user interface toolkit.
  38.  
  39. Copyright (c) 1996 Scott Hudson and Ian Smith
  40. All rights reserved.
  41.  
  42. The subArctic system is freely available for most uses under the terms
  43. and conditions described in 
  44.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  45. and appearing in full in the lib/interactor.java source file.
  46.  
  47. The current release and additional information about this software can be 
  48. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  49.  
  50. ========================================================================*/
  51.